import http from "@/utils/http"

enum Api {
    totalProductAdd = "/api/productCategoryClassification/saveOrUpdate",
    totalProductAttachment = "/api/productCategoryClassification/saveOrUpdateAttachment",
    totalProductPage = "/api/productCategoryClassification/page",
    totalProductList = "/api/productCategoryClassification/list",
    totalProductDetail = "/api/productCategoryClassification/detail",
    totalProductDeleteAttachment = "/api/productCategoryClassification/deleteAttachment",
    totalProductDelete = "/api/productCategoryClassification/delete",

    //产品链接配置管理
    productLinkConfigAdd= '/api/productLinkConfig/saveOrUpdate',
    productLinkConfigPage= '/api/productLinkConfig/page',
    productLinkConfigList= '/api/productLinkConfig/list',
    productLinkConfigDelete= '/api/productLinkConfig/delete',

    // 产品线上运营
    queryProductStatisticsPageApi= '/api/product/statistical/query/productStatisticsPage',
    queryOrderTransformDetailApi= '/api/product/statistical/query/orderTransformDetail',
    queryChartStatisticsApi= '/api/product/statistical/query/chartStatistics',
    queryChannelStatisticsPageApi= '/api/product/statistical/query/channelStatisticsPage',
    productUpdatePutSwitchApi= '/api/product/updatePutSwitch',
    channelUpdatePutSwitchApi= '/api/channel/updatePutSwitch',

}
    // 渠道投放开关
    export const channelUpdatePutSwitchApiPut = async (data: any) => {
        return http.put(`${Api.channelUpdatePutSwitchApi}/${data.id}/${data.switch}`)
    }
    // 产品投放开关
    export const productUpdatePutSwitchApiPut = async (data: any) => {
        return http.put(`${Api.productUpdatePutSwitchApi}/${data.id}/${data.switch}`)
    }
    // 分页查询产品运营数据
    export const queryProductStatisticsPageApiPost = async (data: any) => {
        return http.post(Api.queryProductStatisticsPageApi, data)
    }
    // 订单转化明细
    export const queryOrderTransformDetailApiPost = async (data: any) => {
        return http.post(Api.queryOrderTransformDetailApi, data)
    }
    // 图标数据查询
    export const queryChartStatisticsApiPost = async (data: any) => {
        return http.post(Api.queryChartStatisticsApi, data)
    }
    // 分页查询渠道运营数据
    export const queryChannelStatisticsPageApiPost = async (data: any) => {
        return http.post(Api.queryChannelStatisticsPageApi, data)
    }

export const productLinkConfigAddPost = async (data: any) => {
    return http.post(Api.productLinkConfigAdd, data)
}
export const productLinkConfigPagePost = async (data: any) => {
    return http.post(Api.productLinkConfigPage, data)
}
export const productLinkConfigListPost = async (data: any) => {
    return http.post(Api.productLinkConfigList, data)
}
export const productLinkConfigDeleteDel = async (data: { id: string }) => {
    return http.delete(Api.productLinkConfigDelete, data)
}


export const totalProductAddPost = async (data: any) => {
    return http.post(Api.totalProductAdd, data)
}
export const totalProductAttachmentPost = async (data: any) => {
    return http.post(Api.totalProductAttachment, data)
}
export const totalProductPagePost = async (data: any) => {
    return http.post(Api.totalProductPage, data)
}
export const totalProductListPost = async (data: any) => {
    return http.post(Api.totalProductList, data)
}
export const totalProductDetailGet = async (data: any) => {
    return http.getRestApi(Api.totalProductDetail, data)
}

export const totalProductDeleteAttachmentDel = async (data: { id: string }) => {
    return http.delete(Api.totalProductDeleteAttachment, data)
}
export const totalProductDeleteDel = async (data: { id: string }) => {
    return http.delete(Api.totalProductDelete, data)
}
